import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";
// 出库单列表
export async function getProductOutboundOrderList(params) {
	return request(`/new-wms/productOutboundOrder/listPage?${stringify(params)}`, { loading: true });
}
// 指派退货员
export async function productOutboundOrderAssignedReturnClerk(params) {
	return request(`/new-wms/productOutboundOrder/assignedReturnClerk`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 出库单作废
export async function productOutboundOrderCancellation(params) {
	return request(`/new-wms/productOutboundOrder/cancellation?${stringify(params)}`);
}
// 强制完成
export async function productOutboundOrderForceCompletion(params) {
	return request(`/new-wms/productOutboundOrder/forceCompletion?${stringify(params)}`);
}
// 审核并出库
export async function productOutboundOrderReviewAndRelease(params) {
	return request(`/new-wms/productOutboundOrder/reviewAndRelease?${stringify(params)}`);
}

// 新增退货出库单
export async function productOutboundOrderCreateProductOutboundOrder(params) {
	return request(`/new-wms/productOutboundOrder/createProductOutboundOrder`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 商品详情
export async function productOutboundOrderGetProductByCode(params) {
	return request(`/new-wms/productOutboundOrder/getProductByCode?${stringify(params)}`);
}
// 日志
export async function getLogsPage(params) {
	return request(`/new-wms/logs/page?${stringify(params)}`, { loading: true });
}
export async function querySellNumBySysGoodsId(params) {
	return request(`/zjf-wms/purchase/refund/querySellNumBySysGoodsId?${stringify(params)}`);
}

// 拿货员列表
export async function queryTakeUserList(params) {
	return request(`/blade-user/childUsers?${stringify(params)}`, { loading: true });
}

//新增采购退货单
export async function createPurchaseorder(params) {
	return request(`/zjf-wms/purchase/refund/save`, {
		method: "POST",
		data: params
	});
}
//修改采购单
export async function updatePurchaseorder(params) {
	return request(`/zjf-oms/purchaseorder/update`, {
		method: "POST",
		data: params
	});
}
// 仓库列表
export async function getWarehouseList(params) {
	return request(`/new-wms/inventory/warehouse-list`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 根据商品唯一码或编码查询商品信息
export async function getProductByCode(params) {
	return request(`/new-wms/productOutboundOrder/getProductByCode?${stringify(params)}`, { loading: true });
}
// 查询正品可售数
export async function inventoryTotalInventoryList(params) {
	return request(`/new-wms/inventory/total-inventory-list?${stringify(params)}`, { loading: true });
}
